package guoanmaker.operator.business.repository;

import guoanmaker.operator.business.model.OperatorHotwords;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 *  
 *
 * @author huZhaoyu 
 * @ClassName: OperatorHotwordsRepository
 * @Description: 热词Repository
 * @date 2017/6/27  
 */
public interface OperatorHotwordsRepository extends JpaRepository<OperatorHotwords, String>, JpaSpecificationExecutor<OperatorHotwords> {
	/**
	 * 
	* @Title: findByCityCodetwo 
	* @Description: 热词汇(这里用一句话描述这个方法的作用) 多个
	* @param cityCode
	* @return    设定文件 
	* @return List<OperatorHotwords>    返回类型 
	* @throws 
	 */
	@Query("select u from OperatorHotwords u  where u.cityCode=:cityCode and u.status=1 and u.hotwordAffiliation=2")
   public List<OperatorHotwords> findByCityCodetwo(@Param("cityCode") String cityCode);
	/**
	 * 
	* @Title: findByCityCodeOne 
	* @Description: 热搜索词(这里用一句话描述这个方法的作用) 
	* @param cityCode
	* @return    设定文件 
	* @return OperatorHotwords    返回类型 
	* @throws 
	 */
	@Query("select u from OperatorHotwords u  where u.cityCode=:cityCode and u.status=2 and u.hotwordAffiliation=2")
	   public OperatorHotwords findByCityCodeOne(@Param("cityCode") String cityCode);
	
	/**
	 * pc端多个词汇的
	* @Title: findPcByCityCodetwo 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param cityCode
	* @return    设定文件 
	* @return List<OperatorHotwords>    返回类型 
	* @throws 
	 */
	@Query("select u from OperatorHotwords u  where u.cityCode=:cityCode and u.status=1 and u.hotwordAffiliation=1")
	   public List<OperatorHotwords> findPcByCityCodetwo(@Param("cityCode") String cityCode);
	/**
	 * pc端单个词汇的
	* @Title: findPcByCityCodeOne 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param cityCode
	* @return    设定文件 
	* @return OperatorHotwords    返回类型 
	* @throws 
	 */
	@Query("select u from OperatorHotwords u  where u.cityCode=:cityCode and u.status=2 and u.hotwordAffiliation=1")
	   public OperatorHotwords findPcByCityCodeOne(@Param("cityCode") String cityCode);

}